// ******************************************************************************
// Copyright     :  Copyright (C) 2019, Hisilicon Technologies Co. Ltd.
// File name     :  stlisch_c_union_define.h
// Project line  :  Platform And Key Technologies Development
// Department    :  CAD Development Department
// Author        :  xxx
// Version       :  1.0
// Date          :  2018/9/28
// Description   :  The description of xxx project
// Others        :  Generated automatically by nManager V5.1
// History       :  xxx 2019/05/07 10:21:41 Create file
// ******************************************************************************

#ifndef STLISCH_C_UNION_DEFINE_H
#define STLISCH_C_UNION_DEFINE_H

/* Define the union csr_cnb_int_vector_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 cpi_int_index : 24; /* [23:0] */
        u32 rsv_0 : 3;          /* [26:24] */
        u32 enable : 1;         /* [27] */
        u32 int_issue : 1;      /* [28] */
        u32 rsv_1 : 3;          /* [31:29] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_cnb_int_vector_u;

/* Define the union csr_isch_int_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 int_data : 3;           /* [2:0] */
        u32 rsv_2 : 13;             /* [15:3] */
        u32 program_csr_id_ro : 16; /* [31:16] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_int_u;

/* Define the union csr_isch_int_en_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 int_en : 3;          /* [2:0] */
        u32 rsv_3 : 13;          /* [15:3] */
        u32 program_csr_id : 16; /* [31:16] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_int_en_u;

/* Define the union csr_isch_th_rls_e_error_status_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 th_rls_e_err : 1;       /* [0] */
        u32 th_rls_e_err_insrt : 1; /* [1] */
        u32 th_rls_e_err_info : 9;  /* [10:2] */
        u32 rsv_4 : 21;             /* [31:11] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_th_rls_e_error_status_u;

/* Define the union csr_isch_th_rls_c_error_status_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 th_rls_c_err : 1;       /* [0] */
        u32 th_rls_c_err_insrt : 1; /* [1] */
        u32 th_rls_c_err_info : 9;  /* [10:2] */
        u32 rsv_5 : 21;             /* [31:11] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_th_rls_c_error_status_u;

/* Define the union csr_isch_time_out_error_status_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 timeout_err : 1;       /* [0] */
        u32 timeout_err_insrt : 1; /* [1] */
        u32 timeout_err_info : 9;  /* [10:2] */
        u32 rsv_6 : 21;            /* [31:11] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_time_out_error_status_u;

/* Define the union csr_isch_bp_status_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 qu_bp : 1;  /* [0] */
        u32 rsv_7 : 31; /* [31:1] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_bp_status_u;

/* Define the union csr_isch_bp_ctrl_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 qu_bp_bypass : 1; /* [0] */
        u32 qu_bp_set : 1;    /* [1] */
        u32 rsv_8 : 30;       /* [31:2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_bp_ctrl_u;

/* Define the union csr_isch_force_rls_ctrl_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 th_id_frc : 9; /* [8:0] */
        u32 rsv_9 : 3;     /* [11:9] */
        u32 ctrl_frc : 1;  /* [12] */
        u32 rsv_10 : 19;   /* [31:13] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_force_rls_ctrl_u;

/* Define the union csr_isch_mod_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 watchdog_mode : 3;       /* [2:0] */
        u32 watch_dog_test_mode : 1; /* [3] */
        u32 rsv_11 : 28;             /* [31:4] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_mod_u;

/* Define the union csr_isch_tile_en_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 tile_en : 4; /* [3:0] */
        u32 rsv_12 : 28; /* [31:4] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_tile_en_u;

/* Define the union csr_isch_core0_cfg_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 timer_cr : 10; /* [9:0] */
        u32 rsv_13 : 2;    /* [11:10] */
        u32 cwd_en_cr : 1; /* [12] */
        u32 rsv_14 : 3;    /* [15:13] */
        u32 th_en_cr : 4;  /* [19:16] */
        u32 pg_id_cr : 3;  /* [22:20] */
        u32 rsv_15 : 9;    /* [31:23] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_core0_cfg_u;

/* Define the union csr_isch_channel_cfg_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 max_cnt_ch : 9; /* [8:0] */
        u32 rsv_16 : 3;     /* [11:9] */
        u32 pg_id_ch : 3;   /* [14:12] */
        u32 rsv_17 : 1;     /* [15] */
        u32 wght_ch : 5;    /* [20:16] */
        u32 rsv_18 : 11;    /* [31:21] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_channel_cfg_u;

/* Define the union csr_isch_4iq_cfg_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 wght_iq : 20; /* [19:0] */
        u32 rsv_19 : 12;  /* [31:20] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_4iq_cfg_u;

/* Define the union csr_isch_4th_sta_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 sta_th0 : 1;   /* [0] */
        u32 ch_id_th0 : 6; /* [6:1] */
        u32 rsv_20 : 1;    /* [7] */
        u32 sta_th1 : 1;   /* [8] */
        u32 ch_id_th1 : 6; /* [14:9] */
        u32 rsv_21 : 1;    /* [15] */
        u32 sta_th2 : 1;   /* [16] */
        u32 ch_id_th2 : 6; /* [22:17] */
        u32 rsv_22 : 1;    /* [23] */
        u32 sta_th3 : 1;   /* [24] */
        u32 ch_id_th3 : 6; /* [30:25] */
        u32 rsv_23 : 1;    /* [31] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_4th_sta_u;

/* Define the union csr_isch_core0_sta_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 th0_his_cr : 1; /* [0] */
        u32 th1_his_cr : 1; /* [1] */
        u32 th2_his_cr : 1; /* [2] */
        u32 th3_his_cr : 1; /* [3] */
        u32 rsv_24 : 28;    /* [31:4] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_core0_sta_u;

/* Define the union csr_isch_rls_e_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 rls_e_err_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_rls_e_cnt_u;

/* Define the union csr_isch_rls_c_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 rls_c_err_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_rls_c_cnt_u;

/* Define the union csr_isch_time_out_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 time_out_err_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_time_out_cnt_u;

/* Define the union csr_isch_rls_e_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 th_id_e : 9; /* [8:0] */
        u32 rsv_25 : 23; /* [31:9] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_rls_e_u;

/* Define the union csr_isch_rls_c_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 th_id_c : 9; /* [8:0] */
        u32 rsv_26 : 23; /* [31:9] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_rls_c_u;

/* Define the union csr_isch_rls_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 rls_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_rls_cnt_u;

/* Define the union csr_isch_alc_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 alc_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_alc_cnt_u;

/* Define the union csr_isch_tl_idle_th_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 th_idle_4tile_cnt : 8; /* [7:0] */
        u32 rsv_27 : 24;           /* [31:8] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_isch_tl_idle_th_cnt_u;


// ==============================================================================
/* Define the global struct */
typedef struct {
    volatile csr_cnb_int_vector_u cnb_int_vector;                         /* 0 */
    volatile csr_isch_int_u isch_int;                                     /* 4 */
    volatile csr_isch_int_en_u isch_int_en;                               /* 8 */
    volatile csr_isch_th_rls_e_error_status_u isch_th_rls_e_error_status; /* C */
    volatile csr_isch_th_rls_c_error_status_u isch_th_rls_c_error_status; /* 10 */
    volatile csr_isch_time_out_error_status_u isch_time_out_error_status; /* 14 */
    volatile csr_isch_bp_status_u isch_bp_status;                         /* 18 */
    volatile csr_isch_bp_ctrl_u isch_bp_ctrl;                             /* 1C */
    volatile csr_isch_force_rls_ctrl_u isch_force_rls_ctrl;               /* 20 */
    volatile csr_isch_mod_u isch_mod;                                     /* 24 */
    volatile csr_isch_tile_en_u isch_tile_en;                             /* 28 */
    volatile csr_isch_core0_cfg_u isch_core0_cfg[96];                     /* 30 */
    volatile csr_isch_channel_cfg_u isch_channel_cfg[64];                 /* 1B0 */
    volatile csr_isch_4iq_cfg_u isch_4iq_cfg[128];                        /* 2B0 */
    volatile csr_isch_4th_sta_u isch_4th_sta[96];                         /* 4B0 */
    volatile csr_isch_core0_sta_u isch_core0_sta[96];                     /* 6D0 */
    volatile csr_isch_rls_e_cnt_u isch_rls_e_cnt;                         /* 850 */
    volatile csr_isch_rls_c_cnt_u isch_rls_c_cnt;                         /* 854 */
    volatile csr_isch_time_out_cnt_u isch_time_out_cnt;                   /* 858 */
    volatile csr_isch_rls_e_u isch_rls_e;                                 /* 85C */
    volatile csr_isch_rls_c_u isch_rls_c;                                 /* 860 */
    volatile csr_isch_rls_cnt_u isch_rls_cnt;                             /* 864 */
    volatile csr_isch_alc_cnt_u isch_alc_cnt;                             /* 868 */
    volatile csr_isch_tl_idle_th_cnt_u isch_tl_idle_th_cnt[4];            /* 870 */
} S_qu_stlisch_csr_REGS_TYPE;

/* Declare the struct pointor of the module qu_stlisch_csr */
extern volatile S_qu_stlisch_csr_REGS_TYPE *gopqu_stlisch_csrAllReg;

/* Declare the functions that set the member value */
int iSetCNB_INT_VECTOR_cpi_int_index(unsigned int ucpi_int_index);
int iSetCNB_INT_VECTOR_enable(unsigned int uenable);
int iSetCNB_INT_VECTOR_int_issue(unsigned int uint_issue);
int iSetISCH_INT_int_data(unsigned int uint_data);
int iSetISCH_INT_program_csr_id_ro(unsigned int uprogram_csr_id_ro);
int iSetISCH_INT_EN_int_en(unsigned int uint_en);
int iSetISCH_INT_EN_program_csr_id(unsigned int uprogram_csr_id);
int iSetISCH_TH_RLS_E_ERROR_STATUS_th_rls_e_err(unsigned int uth_rls_e_err);
int iSetISCH_TH_RLS_E_ERROR_STATUS_th_rls_e_err_insrt(unsigned int uth_rls_e_err_insrt);
int iSetISCH_TH_RLS_E_ERROR_STATUS_th_rls_e_err_info(unsigned int uth_rls_e_err_info);
int iSetISCH_TH_RLS_C_ERROR_STATUS_th_rls_c_err(unsigned int uth_rls_c_err);
int iSetISCH_TH_RLS_C_ERROR_STATUS_th_rls_c_err_insrt(unsigned int uth_rls_c_err_insrt);
int iSetISCH_TH_RLS_C_ERROR_STATUS_th_rls_c_err_info(unsigned int uth_rls_c_err_info);
int iSetISCH_TIME_OUT_ERROR_STATUS_timeout_err(unsigned int utimeout_err);
int iSetISCH_TIME_OUT_ERROR_STATUS_timeout_err_insrt(unsigned int utimeout_err_insrt);
int iSetISCH_TIME_OUT_ERROR_STATUS_timeout_err_info(unsigned int utimeout_err_info);
int iSetISCH_BP_STATUS_qu_bp(unsigned int uqu_bp);
int iSetISCH_BP_CTRL_qu_bp_bypass(unsigned int uqu_bp_bypass);
int iSetISCH_BP_CTRL_qu_bp_set(unsigned int uqu_bp_set);
int iSetISCH_FORCE_RLS_CTRL_th_id_frc(unsigned int uth_id_frc);
int iSetISCH_FORCE_RLS_CTRL_ctrl_frc(unsigned int uctrl_frc);
int iSetISCH_MOD_watchdog_mode(unsigned int uwatchdog_mode);
int iSetISCH_MOD_watch_dog_test_mode(unsigned int uwatch_dog_test_mode);
int iSetISCH_TILE_EN_tile_en(unsigned int utile_en);
int iSetISCH_CORE0_CFG_timer_cr(unsigned int utimer_cr);
int iSetISCH_CORE0_CFG_cwd_en_cr(unsigned int ucwd_en_cr);
int iSetISCH_CORE0_CFG_th_en_cr(unsigned int uth_en_cr);
int iSetISCH_CORE0_CFG_pg_id_cr(unsigned int upg_id_cr);
int iSetISCH_CHANNEL_CFG_max_cnt_ch(unsigned int umax_cnt_ch);
int iSetISCH_CHANNEL_CFG_pg_id_ch(unsigned int upg_id_ch);
int iSetISCH_CHANNEL_CFG_wght_ch(unsigned int uwght_ch);
int iSetISCH_4IQ_CFG_wght_iq(unsigned int uwght_iq);
int iSetISCH_4TH_STA_sta_th0(unsigned int usta_th0);
int iSetISCH_4TH_STA_ch_id_th0(unsigned int uch_id_th0);
int iSetISCH_4TH_STA_sta_th1(unsigned int usta_th1);
int iSetISCH_4TH_STA_ch_id_th1(unsigned int uch_id_th1);
int iSetISCH_4TH_STA_sta_th2(unsigned int usta_th2);
int iSetISCH_4TH_STA_ch_id_th2(unsigned int uch_id_th2);
int iSetISCH_4TH_STA_sta_th3(unsigned int usta_th3);
int iSetISCH_4TH_STA_ch_id_th3(unsigned int uch_id_th3);
int iSetISCH_CORE0_STA_th0_his_cr(unsigned int uth0_his_cr);
int iSetISCH_CORE0_STA_th1_his_cr(unsigned int uth1_his_cr);
int iSetISCH_CORE0_STA_th2_his_cr(unsigned int uth2_his_cr);
int iSetISCH_CORE0_STA_th3_his_cr(unsigned int uth3_his_cr);
int iSetISCH_RLS_E_CNT_rls_e_err_cnt(unsigned int urls_e_err_cnt);
int iSetISCH_RLS_C_CNT_rls_c_err_cnt(unsigned int urls_c_err_cnt);
int iSetISCH_TIME_OUT_CNT_time_out_err_cnt(unsigned int utime_out_err_cnt);
int iSetISCH_RLS_E_th_id_e(unsigned int uth_id_e);
int iSetISCH_RLS_C_th_id_c(unsigned int uth_id_c);
int iSetISCH_RLS_CNT_rls_cnt(unsigned int urls_cnt);
int iSetISCH_ALC_CNT_alc_cnt(unsigned int ualc_cnt);
int iSetISCH_TL_IDLE_TH_CNT_th_idle_4tile_cnt(unsigned int uth_idle_4tile_cnt);


#endif // STLISCH_C_UNION_DEFINE_H
